<!--#Include File="../Inc/Config.asp"-->
<!--#Include File="../Inc/Md5.asp"--><%
'--------------------------------------
'Power By 方卡在线 @2010-2014 f02
'URL:http://www.fangka.net/
'EMail:admin@ifangka.com
'QQ:861118936
'版权所有 未经允许不得去除本版权信息
'--------------------------------------

Dim Fk_Admin_LoginName,Fk_Admin_LoginPass

Types=Clng(Request.QueryString("Type"))

Select Case Types
	Case 1
		Call LoginBox() '读取登录信息
	Case 2
		Call LoginDo() '登录操作
	Case Else
		Response.Redirect("Index.asp")
		Call FKFun.PageEnd()
End Select

'==========================================
'函 数 名：LoginBox()
'作    用：读取登录信息
'==========================================
Sub LoginBox()
%>
<form id="AdminLogin" name="AdminLogin" method="post" target="ajax" action="Login.asp?Type=2" hrefUrl="Index.asp">
<div id="title">管理员登录</div>
<div id="box">
	<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td width="24%" height="30" align="right">登录名：</td>
			<td width="76%">&nbsp;<input name="Fk_Admin_LoginName" type="text" class="input" id="Fk_Admin_LoginName" /></td>
		</tr>
		<tr>
			<td height="30" align="right">密码：</td>
			<td>&nbsp;<input name="Fk_Admin_LoginPass" type="password" class="input" id="Fk_Admin_LoginPass" /></td>
		</tr>
	</table>
</div>
<div id="bottom">
	<input type="submit" class="button" name="Enter" id="Enter" value="登 录" />
</div>
</form>
<%
End Sub

'==========================================
'函 数 名：LoginDo()
'作    用：登录操作
'==========================================
Sub LoginDo()
	Fk_Admin_LoginName=FKFun.HTMLEncode(Trim(Request.Form("Fk_Admin_LoginName")))
	Fk_Admin_LoginPass=FKFun.HTMLEncode(Trim(Request.Form("Fk_Admin_LoginPass")))
	Call FKFun.JsonString(Fk_Admin_LoginName,1,50,0,"请输入登录名！","登录名名不能大于50个字符！")
	Call FKFun.JsonString(Fk_Admin_LoginPass,1,50,0,"请输入登录密码！","登录密码不能大于50个字符！")
	Sqlstr="Select Fk_Admin_LoginName,Fk_Admin_LoginPass From [Fk_Admin] Where Fk_Admin_State=1 And Fk_Admin_LoginName='"&Fk_Admin_LoginName&"' And Fk_Admin_LoginPass='"&Md5(Md5(Fk_Admin_LoginPass,32),16)&"'"
	Rs.Open Sqlstr,Conn,1,1
	If Not Rs.Eof Then
		Response.Cookies("u_f02")=Fk_Admin_LoginName
		Response.Cookies("p_f02")=Md5(Rs("Fk_Admin_LoginPass")&"f02"&Request.ServerVariables("REMOTE_ADDR")&Date(),16)
		Call FKFun.JsonSuccess()
	Else
		Rs.Close
		Call FKFun.JsonError("用户名或密码错误！")
	End If
	Rs.Close
End Sub

Call FKFun.PageEnd()
%>
